Page({
  goDetail(e) {
    wx.navigateTo({
      url: "/repair_pkg/pages/detail/index?id=" + e.mark.id,
    });
  },
  addRepair() {
    wx.navigateTo({
      url: "/repair_pkg/pages/form/index",
    });
  },
  data: {
    repairList: [],
  },
  onLoad() {
    this.getRepairList();
  },
  async getRepairList() {
    const {
      code,
      data: { rows },
    } = await wx.http.get("/repair", {
      current: 1,
      pageSize: 20,
    });
    // 判断code
    if (code !== 10000) return wx.utils.toast("获取数据失败");
    this.setData({
      repairList: rows,
    });
  },
});
